//
//  KcPhoneFlowLayout.swift
//  KcSwiftDemo
//
//  Created by 张杰 on 2017/8/23.
//  Copyright © 2017年 张杰. All rights reserved.
//

import UIKit

class KcPhoneFlowLayout: UICollectionViewFlowLayout {
    override func prepare() {
        super.prepare()
        
        let count: CGFloat = 3
        let edge = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
        let w = collectionView?.frame.size.width
        let itemW = (w! - edge.left - edge.right - 10 * (count - 1)) / count
        
        itemSize = CGSize(width: itemW, height: itemW)
        minimumLineSpacing = 10
        minimumInteritemSpacing = 10
        scrollDirection = .vertical
    }
}
